<script setup lang="ts">
import {computed} from 'vue'
import {useStore} from "vuex"

const store = useStore()
const value = computed({
  get: () => store.getters["auth/getTabbar"],
  set: (name: string) => store.dispatch('auth/setTabbar', name)
})
const handleChange = (name: string) => {
  value.value = name
  uni.switchTab({
    url: `/pages/${name}/index`
  })

}
</script>

<template>
  <view>
    <u-tabbar
        :value="value"
        @change="handleChange"
        :placeholder="false"
        :safeAreaInsetBottom="false"
    >
      <u-tabbar-item text="首页" icon="home" name="index"></u-tabbar-item>
      <u-tabbar-item text="我的" icon="account" name="mine"></u-tabbar-item>
    </u-tabbar>
  </view>
</template>

<style scoped lang="scss">

</style>